<?php namespace Phpcmf\Model\Duixin; 
/**
 * https://duixin.cc
 * 对信
 * 本文件是框架系统文件，二次开发时不可以修改本文件，可以通过继承类方法来重写此文件
 **/

// 后台权限控制模型

class Auth extends \Phpcmf\Model {

    protected $_auth_uri = '';
    protected $_is_post_user = -1;
    protected $_is_admin_min_mode = -1;
    protected $_is_post_user_status = -1;

    /**
     * 通知短信
     *
     * @param   $data    数据
     * //'status' => 0,
     */
    public function addtongzhi($data) {

        $datas = [
            //'site' => (int)$site,
            'catid'=> $data['catid'], //类型
            'title' => $data['title'], //标题
            'zhiding' => $data['zhiding'], //置顶
            'content'=> $data['content'], //通知内容
            'uid'=> (int)$data['uid'], //发布人的uid
            'faxinren'=> (int)$data['uid'], //发布人的uid
            'shouxinren'=> (int)$data['shouxinren'],//收信人
            'tupian'=> $data['tupian'], //图片
            'shipin'=> $data['shipin'], //视频
            'yuyin'=> $data['yuyin'], //语音
            'fujian'=> $data['fujian'], //附件
            'yidu'=> $data['yidu'] ? $data['yidu'] : 0, //已读
            'quanziid'=> $data['quanziid'], //圈子ID
            'quantieid'=> $data['quantieid'], //圈帖ID
            'url' => $data['url'],
            'updatetime' => 0,
            'inputtime' => SYS_TIME,
        ];
        
        $this->db->table('1_duixin')->insert($datas);
        
        $datac = [
            'uid'=> (int)$data['uid'], //发布人的uid
            'catid'=> $data['catid'], //类型
        ];
        $this->db->table('1_duixin_data_0')->insert($datac);

    }
}